\subsection{Tangent spaces}
Let \( V \subseteq \mathbb A^n \) be an affine hypersurface, so \( V = \mathbb V(f) \).
We assume that \( f \) is irreducible, so \( V \) is also irreducible.
Let \( P = (a_1, \dots, a_n) = (\vb a) \in V \).
An affine line through \( P \) has the form \( L = \qty{(a_1 + b_1 t, \dots, a_n + b_n t) \mid t \in \mathbb C} \) for \( (\vb b) \in \mathbb C^n \setminus \qty{\vb 0} \) is fixed.

The intersection \( V \cap L \) is the set of points on \( L \) where \( f \) vanishes.
This gives \( 0 = f(a_1 + b_1 t, \dots, a_n + b_n t) = g(t) = \sum_r c_r t^r \), a polynomial in \( t \).
Since \( P \in V \cap L \), \( c_0 = 0 \).
The linear term \( c_1 \) is given by \( c_1 = \sum_i b_i \pdv{f}{X_i}(\vb a) \).
Geometric tangency of \( L \) to \( V \) is equivalent to the statement that \( c_1 = 0 \).
\begin{definition}
    The line \( L \) through \( P \) is \emph{tangent} to \( V = \mathbb V(f) \) at \( P \) if it is contained in the \emph{tangent space} of \( V \) at \( P \), defined by \( T_{V,P}^{\mathrm{aff}} = \mathbb V(g) \subseteq \mathbb A^n \) where
    \[ g = \sum_{i=1}^n \qty(\pdv{f}{X_i}\qty(P))(X_i - a_i) \]
\end{definition}
Note that \( g \) is linear.
\( T_{V,P}^{\mathrm{aff}} \) is \( n \)-dimensional if \( g = 0 \) and \( (n-1) \)-dimensional otherwise, taking the dimensions as an affine space.
\begin{definition}
    If \( \dim T_{V,P}^{\mathrm{aff}} = n \), we say that \( P \) is a \emph{singular point} of \( V \).
    Otherwise, it is a \emph{smooth point}.
\end{definition}
\begin{example}[nodal cubic]
    Consider the affine hypersurface \( C = \mathbb V(Y^2 - X^2(X+1)) \).
    One can show by direct calculation that the only singular point is \( (0, 0) \).
\end{example}
\begin{example}[cusp]
    Consider \( C = \mathbb V(Y^2 - X^3) \).
    Again, the point \( (0, 0) \) is the only singular point.
\end{example}
Let \( V \subseteq \mathbb V(F) \subseteq \mathbb P^n \) for \( F \) an irreducible homogeneous polynomial.
\begin{definition}
    The \emph{projective tangent space} to \( V \) at \( P \) is \( T_{V,P}^{\mathrm{proj}} = \mathbb V(G) \) where
    \[ G = \sum_{i=0}^n \qty(\pdv{F}{X_i}\qty(P)) X_i \]
\end{definition}
To see that \( P \in \mathbb V(G) \), note that \( F(X_0, \dots, X_n) = \frac{1}{\deg F} \sum_{i=0}^n X_i \pdv{F}{X_i} \); this is sometimes known as \emph{Euler's formula}.
Smooth points and singular points are defined as in the affine case.
From the inverse function theorem, if all points are smooth, the tangent space is a manifold.

The affine and projective tangent spaces are compatible in a particular sense.
Let \( V = \mathbb V(F) \not\subseteq \qty{X_0 = 0} \), and consider \( V_0 = V \cap U_0 \).
If \( P \in V_0 \subseteq V \), we can compute \( T_{V,P}^{\mathrm{proj}} \cap U_0 \) and \( T_{V_0,P}^{\mathrm{aff}} \), which are both subsets of \( \mathbb A^n \).
Let \( V_0 = \mathbb V(f) \), then \( F(X_0, \dots, X_n) = X_0^{\deg F} f\qty(\frac{X_1}{X_0}, \dots, \frac{X_n}{X_0}) \).
By computing \( \pdv{F}{X_i} \), we find that if \( P \in V_0 \), \( T_{V,P}^{\mathrm{proj}} \cap U_0 = T_{V_0,P}^{\mathrm{aff}} \).
\begin{proposition}
    The set of singular points on a nonempty irreducible projective hypersurface is a proper Zariski closed subset.
    In particular, the set of smooth points is dense.
\end{proposition}
\begin{proof}
    The set of singular points is the intersection of \( V \) with \( \bigcap_i \mathbb V\qty(\pdv{F}{X_i}) \), so is a closed subvariety of \( V \).
    If \( V \cap \bigcap_i \mathbb V\qty(\pdv{F}{X_i}) = V \), then by the Nullstellensatz, \( \pdv{F}{X_i} \in I^h(V) \).
    However, \( I^h(V) \) is principal and generated by \( F \).
    Since \( \pdv{F}{X_i} \) is homogeneous and of smaller degree, \( \pdv{F}{X_i} \mid F \) gives that \( \pdv{F}{X_i} = 0 \).
    So \( F \) is a constant polynomial, giving \( V = \mathbb P^n \) as it is nonempty, which has no singular points.
\end{proof}
We can extend the definition of a tangent space to general varieties not generated by a single polynomial.
\begin{definition}
    Let \( V \subseteq \mathbb A^n \) be an affine variety, and let \( P \in V \).
    Then the \emph{tangent space} to \( V \) at \( P \) is
    \[ T_{V,P} = \qty{\vb v \in \mathbb C^n \midd \sum_{i=1}^n v_i \pdv{f}{x_i}\qty(P) = 0 \text{ for all } f \in I(V)} \subseteq \mathbb C^n \]
\end{definition}
This is a vector subspace of \( \mathbb C^n \).
\begin{definition}
    Let \( V \subseteq \mathbb P^n \) be a projective variety, and let \( P \in V \).
    Suppose \( V_j = V \cap \qty{X_j \neq 0} \) is an affine piece containing \( P \).
    Then the \emph{tangent space} to \( V \) at \( P \) is \( T_{V,P} = T_{V_j,P} \).
\end{definition}
Note that this definition requires a choice of \( j \); it is not clear that this is well-defined.
This will be addressed by the following propositions.

Recall that \( \mathbb P^n \) is covered by \( U_0, \dots, U_n \), and \( U_i \simeq \mathbb A^n \).
Each point \( P \in \mathbb P^n \) is contained in at least one of these \( U_i \).
If the index is unimportant, we will write \( \mathbb A_n \subseteq \mathbb P^n \) rather than \( U_i \subseteq \mathbb P^n \).

Let \( V \subseteq \mathbb P^n, W \subseteq \mathbb P^m \) be irreducible varieties and \( \varphi \colon V \dashrightarrow W \) be a rational map.
Given \( P \in \dom \varphi \subseteq V \) and \( Q = \varphi(P) \subseteq W \cap \mathbb A^m \), we will now define \( \dd{\varphi}_P \colon T_{V,P} \dashrightarrow T_{W,P} \).
Suppose \( \varphi \) is determined by \( (F_0, \dots, F_m) \), where the \( F_i \) are homogeneous and of the same degree.
By restricting to \( \mathbb A^n \), we can write \( \frac{F_j}{F_0}(1, X_1, \dots, X_n) = f_j \in \mathbb C(X_1, \dots, X_n) \).
This gives rational functions \( f_1, \dots, f_m \) on \( V \cap \mathbb A^n \).
The \emph{derivative} of \( \varphi \) at \( P \) or \emph{linearisation} of \( \varphi \) at \( P \) is defined by
\[ \dd{\varphi}_P(v) = \qty(\sum_{i=1}^n v_i \pdv{f_j}{X_i}\qty(P))_j \]
which is initially a function \( T_{V,P} \to \mathbb C^m \).
This can be thought of as an application of the matrix of derivatives of \( f \) at \( P \) to the vector \( v \).
\begin{proposition}
    \begin{enumerate}
        \item \( \dd{\varphi}_P(T_{V,P}) \subseteq T_{W,Q} \);
        \item the linear map \( \dd{\varphi}_P \) depends only on \( \varphi \) and not the representatives;
        \item if \( \psi \colon W \dashrightarrow Z \) is rational with \( \varphi(P) \in \dom \psi \), then \( \dd{(\psi \circ \varphi)}_P = \dd{\psi}_{\varphi(P)} \circ \dd{\psi}_P \);
        \item if \( \varphi \) is birational and \( \varphi^{-1} \) is regular at \( \varphi(P) \), then \( \dd{\varphi}_P \) is an isomorphism \( T_{V,P} \simeq T_{W,Q} \).
    \end{enumerate}
\end{proposition}
\begin{proof}
    \emph{Part (i).}
    We use \( Y_j \) for coordinates in \( W \).
    Replace \( V \) with \( V_0 \) and \( W \) with \( W_0 \).
    Let \( g \in I(W) \), and consider its linearisation at \( Q \).
    Applying the map \( \varphi^\star \) on function fields, we obtain \( \varphi^\star(g) = h = g(f_1, \dots, f_m) \in \mathbb C(V) \).
    Choose a representiative in \( \mathbb C(X) \), representing a rational function on \( V \) that is regular at \( P \).
    This map vanishes when it is regular as \( \varphi(\dom \varphi) \subseteq W \).
    By the chain rule,
    \[ \pdv{h}{X_i}\qty(P) = \sum_j \pdv{g}{Y_j}\qty(Q) \pdv{f_j}{X_i}\qty(P) \]
    Hence, \( v \in T_{V,P} \) gives \( \dd{\varphi}_P(v) \in T_{W,Q} \).

    \emph{Part (ii).}
    If \( (F_0', \dots, F_m') \) is another representation of \( \varphi \) with corresponding rational functions \( f_1', \dots, f_m' \in \mathbb C(V) \).
    Then \( f_j - f_j' \) vanishes on \( V \) whenever it is defined, or equivalently, \( f_j - f_j' = \frac{p_j}{q_j} \) where \( p_j \in I(V) \) and \( q_j(P) \neq 0 \).
    Applying the quotient rule and the fact that \( p_j \in I(V) \),
    \[ \pdv{(f_j - f_j')}{X_i} = \frac{-1}{q_j(P)} = \pdv{p_j}{X_i}\qty(P) = 0 \]
    Hence, \( v \in T_{V,P} \) gives \( \sum_i v_i \pdv{(f_j - f_j')}{X_i}\qty(P) = 0 \) as required.

    \emph{Part (iii).}
    Follows from the chain rule from multivariate calculus.

    \emph{Part (iv).}
    Immediate from (iii).
\end{proof}
Note that if \( P \in U_i \cap U_j \), we have two different definitions of the tangent space \( T_{V,P} \).
Suppose that \( V = \mathbb P^n \), then there is a birational map \( p_{ij} \colon U_i \dashrightarrow U_j \) which is the identity on \( U_i \cap U_j \).
Part (iv) of the above proposition gives an isomorphism from \( T_{P,U_i} \) to \( T_{P,U_j} \) given by \( \dd{p}_{ij} \).
\subsection{Smooth and singular points}
\begin{definition}
    Let \( V \) be an affine or projective variety.
    If \( V \) is irreducible, the \emph{dimension} of \( V \), written \( \dim V \), is the minimum dimension of a tangent space for a point in \( V \).
    If \( P \in V \) and \( V \) is irreducible, we say \( P \) is a \emph{smooth point} of \( V \) if \( \dim T_{V,P} = \dim V \).
    Otherwise, \( P \) is a \emph{singular point}.
    If \( V \) is reducible, we define \( \dim V \) to be the maximum dimension of an irreducible component of \( V \).
\end{definition}
\begin{theorem}
    Let \( V \) be a nonempty irreducible affine or projective variety.
    Then the set of smooth points of \( V \) is a nonempty open subset of \( V \).
\end{theorem}
\begin{proof}
    The fact that the set is nonempty is clear as the minimum dimension must be attained at a point.
    We can assume \( V \subseteq \mathbb A^n \) is affine.
    If \( P \in V \),
    \[ T_{V,P} = \qty{\vb v \in \mathbb C^n \midd \sum_{i=1}^n v_i \pdv{f_j}{x_i}\qty(P) = 0} \]
    where \( f_j \) is some finite set of functions with \( \mathbb V(\qty{f_j}) = V \).
    Then
    \[ \dim T_{V,P} = n - \rank \pdv{f_j}{X_i}\qty(P) \]
    For any \( r \in \mathbb N \),
    \[ \qty{P \in V \mid \dim T_{V,P} \geq r} = \qty{P \in V \midd \rank \pdv{f_j}{X_i}\qty(P) \leq n - r} \]
    This is the subvariety given by the vanishing locus of the \( (n-r+1) \times (n-r+1) \) minors of this matrix \( \pdv{f_j}{X_i}\qty(P) \), which is closed.
\end{proof}
\begin{corollary}
    If \( V, W \) are irreducible and birational, then \( \dim V = \dim W \).
\end{corollary}

\subsection{Transcendental extensions}
If \( K \subseteq L \) are fields and \( \alpha \in L \), we say that \( \alpha \) is \emph{transcendental} over \( K \) if it is not a solution to a nontrivial polynomial \( f \in K[t] \).
More generally, if \( S \subseteq L \) is any set of elements, we say they are \emph{algebraically independent} if they do not satisfy a nontrivial polynomial relation over \( K \).
A field extension \( K / \mathbb C \) is a \emph{pure transcendental extension} if \( K \) is generated by transcendental algebraically independent elements \( x_1, \dots, x_n \in K \).

If \( V \) is an irreducible affine variety, recall that \( \mathbb C(V) = FF\qty(\faktor{\mathbb C[\vb X]}{I(V)}) \).
If \( V = \mathbb P^1 \), \( \mathbb C(V) \simeq \mathbb C(X) \).
\begin{proposition}
    Let \( K / \mathbb C \) be a finitely generated field extension.
    Then, there exists a pure transcendental subfield \( K_0 = \mathbb C(x_1, \dots, x_m) \subseteq K \) such that \( K / K_0 \) is finite (and hence algebraic).
    Moreover, \( K = K_0(y) \) for some \( y \in K \).
\end{proposition}
\begin{proof}
    The final statement follows from the primitive element theorem from Part II Galois Theory.
    We now prove the first part.
    \( K \) is finitely generated, so let \( x_1, \dots x_n \) generate \( K \).
    There is a maximal algebraically independent subset which after relabelling is given by \( \qty{x_1, \dots, x_m} \) for \( m \leq n \).
    Then \( x_{m+1}, \dots, x_n \) are algebraic over \( K_0 = \mathbb C(x_1, \dots, x_m) \).
\end{proof}
\begin{proposition}
    Let \( K = \mathbb C(x_1, \dots, x_n) \), where \( x_1, \dots, x_n \) are algebraically independent.
    Let \( x_{n+1} \) be algebraic over \( K \).
    Define
    \[ I = \qty{g \in \mathbb C[X_1, \dots, X_{n+1}] \mid g(x_1, \dots, x_n, x_{n+1}) = 0} \]
    Then \( I \) is a principal ideal generated by an irreducible element \( f \in \mathbb C[\vb X] \).
    Moreover, if \( f \) contains the variable \( X_i \), then \( \qty{x_1, \dots, x_{i-1}, x_{i+1}, \dots, x_n, x_{n+1}} \) is algebraically independent.
\end{proposition}
\begin{proof}
    As \( x_1, \dots, x_n \) are algebraically independent, the subring \( R = \mathbb C[x_1, \dots, x_n] \subseteq K \) is isomorphic to the polynomial ring \( \mathbb C[X_1, \dots, X_n] \).
    \( \mathbb C[X_1, \dots, X_n] \) is a unique factorisation domain.
    There exist polynomials \( g \in K[T] \) where \( x_{n+1} \) is a root, as it is algebraic.
    Since \( K[T] \) is a principal ideal domain, the ideal of such polynomials is principal, and generated by a unique monic polynomial \( h(t) \), called the minimal polynomial of \( x_{n+1} \).
    The minimal polynomial is irreducible.

    Let \( b \) be the least common multiple of the denominators in \( h(t) \), so \( b \in R \).
    By Gauss' lemma, \( f = bh \) is irreducible in \( R[T] \).
    By the isomorphism \( R \simeq \mathbb C[X_1, \dots, X_n] \), we can think of \( f \) as an element of \( \mathbb C[X_1, \dots, X_{n+1}] \).

    We show that \( f \) generates \( I \).
    Suppose \( g \in \mathbb C[\vb X] \) such that \( g(x_1, \dots, x_{n+1}) = 0 \).
    In \( K[T] \), \( g(x_1, \dots, x_n, T) \) is divisible by \( f(x_1, \dots, x_n) \).
    By Gauss' lemma, \( f \mid g \) in \( \mathbb C[\vb X] \).
    Hence \( f \) generates \( I \) as required.
    The last part is left as an exercise.
    % in online notes
\end{proof}
\begin{corollary}
    Let \( V \) be any irreducible variety.
    Then \( V \) is birational to a hypersurface.
\end{corollary}
\begin{proof}
    Let \( K \) be the function field of \( V \).
    By the above discussion, we can find elements that generate \( K \) that are given by \( x_1, \dots, x_{n+1} \) where \( x_1, \dots, x_n \) are algebraically independent and \( x_{n+1} \) is algebraic over \( \mathbb C(x_1, \dots, x_n) \).
    By the previous proposition, \( K \supseteq \mathbb C[x_1, \dots, x_{n+1}] = \faktor{\mathbb C[X_1, \dots, X_{n+1}]}{(f)} \).
    We take the hypersurface \( \mathbb V(f) \subseteq \mathbb A^{n+1} \).
\end{proof}
We have shown above that birational varieties have the same dimension.
We therefore have the following corollary.
\begin{corollary}
    Let \( W \) be an irreducible variety, and let \( V = \mathbb V(f)\subseteq \mathbb A^n \) be an affine hypersurface birational to \( W \), where \( f \) is non-constant.
    Then the dimension of \( W \) is equal to \( n - 1 \).
\end{corollary}
In the language of field theory, the dimension of \( W \) is the transcendence degree of the field \( \mathbb C(W) \).

% nullstellensatz comments:
% cor 12.2 is nonexaminable; 12.4 (strong nullstellensatz) has proof in notes, proof nonexaminable
